#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <queue>

using namespace std;
typedef long long ll;
const int N = 1e5 + 10;

int n, k;

int main()
{
    cin >> n >> k;
    int ai = 0;
    ll sum = 0;
    priority_queue<int> pq;

    for (int i = 0; i < n; ++i)
    {
        cin >> ai;
        sum += ai;
        if (ai % 2 == 0)
            pq.push(ai);
    }

    while (pq.size() && k--)
    {
        int t = pq.top();
        pq.pop();

        sum -= t / 2;
        if (t / 2 % 2 == 0)
            pq.push(t / 2);
    }

    cout << sum << endl;
    return 0;
}